package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-05-24
 * 22:31
 */
public class addoperation implements Ioperation{
    @Override
    public void work(BookList bookList) {

        System.out.println("调用增加图书。。。");
        System.out.println("输入你要增加的图书名：");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();

        System.out.println("请输入该图书的作者：");
        String author=scanner.nextLine();

        System.out.println("请输入该图书的类型：");
        String type=scanner.nextLine();

        System.out.println("请输入该图书的价格：");
        int price=scanner.nextInt();

        Book book=new Book(name,author,price,type);
        bookList.setBooks(book,bookList.getSizdUsed());
        bookList.setSizdUsed(bookList.getSizdUsed()+1);
    }

}
